package com.foreknow.springboot.mapper;
import com.foreknow.springboot.po.Business;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author xiaoming
 * @version jdk1.8
 * @date 2022/8/12 14:29
 * @function:
 */
//   表示当前的Mapper层交给Mybatis来实现
@Mapper
public interface BusinessMapper {
    /**
     * 根据点餐分类编号查询所属商家信息
     * @param orderTypeId 分类的编号
     * @return List<Business>
     */
    @Select("select * from business where orderTypeId=#{orderTypeId} order by businessId")
    public List<Business> listBusinessOrderTypeId(Integer orderTypeId);

    /**
     * 根据商家编号查询商家信息
     * @param businessId 对象
     * @return
     */
    @Select("select * from business where businessId=#{businessId}")
    public Business getBusinessById(Integer businessId);
}
